<!-- components/cards/UserInfoCard.vue -->
<template>
    <a-descriptions :column="1" size="small" class="user-info">
        <a-descriptions-item label="用户名">
            <UserOutlined />
            {{ user?.username }}
        </a-descriptions-item>
        <a-descriptions-item label="邮箱">
            <MailOutlined />
            {{ user?.email }}
        </a-descriptions-item>
        <a-descriptions-item label="仓库数量">
            <FolderOpenOutlined />
            {{ repositoryCount }} 个
        </a-descriptions-item>
        <a-descriptions-item label="最后操作">
            <FieldTimeOutlined />
            {{ lastOperationTime }}
        </a-descriptions-item>
    </a-descriptions>
</template>
  
<script setup lang="ts">
import { UserOutlined, MailOutlined, FolderOpenOutlined, FieldTimeOutlined } from '@ant-design/icons-vue'

interface UserInfoCardProps {
    user?: {
        username: string
        email: string
    }
    repositoryCount: number
    lastOperationTime?: string
}

const props = withDefaults(defineProps<UserInfoCardProps>(), {
    repositoryCount: 0,
    lastOperationTime: '暂无操作'
})
</script>